Xbasic
a5_ai_generate_speech Function
Syntax
c a5_ai_generate_speech(c namedresource, c prompt, c filename[, c extra])
Arguments
- namedresource
Named resource for specifying ai server to use, api key, model and settings.
- prompt
Speech text to convert to spoken audio file.
- filename
Name of audio file to create.
- extra
Provider/model specific JSON for advanced parameters (e.g., voice, speed, format). Optional.
Returns
- result
Result indicating Success, otherwise and error string with '#Error' prefix
Description
Request an AI text to speech modle to produce spoken audio from text.
Example
' Note - in this case the AI provider was 'openai' and the model was 'tts-1'
a5_ai_generate_speech("openaitts","Welcome to our automation platform","c:\audio\welcome.mp3")